﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;

namespace Daphne.Forms
{
    /// <summary>
    /// Interaction logic for AboutBox.xaml
    /// </summary>
    public partial class AboutBox : Window
    {
        private const string _sPicture = "AppData\\Pictures\\daphne.jpg";
        private int marginBottom = 45;

        public AboutBox()
        {
            InitializeComponent();
            btnClose.Click += new RoutedEventHandler(btnClose_Click);

            /*System.Reflection.Assembly assembly = System.Reflection.Assembly.GetExecutingAssembly();
            _uxVersion.Text = assembly.GetName().Version.ToString() + " beta";*/

            string sPath = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location);
            BitmapSource bs = new BitmapImage(new Uri(System.IO.Path.Combine(sPath, _sPicture)));

            this.WindowStyle = System.Windows.WindowStyle.None;
            this.Width = bs.PixelWidth;
            this.Height = bs.PixelHeight + marginBottom;
            this.WindowStartupLocation = System.Windows.WindowStartupLocation.CenterOwner;

            uxSplash.Source = bs;
        }

        void btnClose_Click(object sender, RoutedEventArgs e)
        {
            this.Close();
        }
    }
}
